﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AddUser.aspx.cs" Inherits="XMLSQL.Admin.ManageUser" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        $(function () {
            //jquery validation
            $("#Form1").validate();
        });
    </script>

    <style type="text/css">
        .error {
            color: red;
        }
    </style>

    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 205px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>
                        Create a New Account
                    </h2>
                    <asp:Label ID="ErrorLabel" CssClass="error" runat="server"></asp:Label>
                    <p>
                        Use the form below to create a new account.
                    </p>
                    <p>
                       Passwords are required to be a minimum of <%= Membership.MinRequiredPasswordLength %> characters in length.
                    </p>
                    <span class="failureNotification">
                        <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
                    </span>
                    <asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification" 
                         ValidationGroup="RegisterUserValidationGroup"/>
    <table class="style1">
        <tr>
            <td class="style2">
                Username</td>
            <td>
                <asp:TextBox ID="tbusername" runat="server" style="margin-left: 0px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="tbusername" 
                                     CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Password</td>
            <td>
                <asp:TextBox ID="tbpassword" runat="server"  minlength="6" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="tbpassword" 
                                     CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Confirm Password</td>
            <td>
                <asp:TextBox ID="tbpassword2" runat="server" minlength="6" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ControlToValidate="tbpassword2" CssClass="failureNotification" Display="Dynamic" 
                                     ErrorMessage="Confirm Password is required." ID="ConfirmPasswordRequired" runat="server" 
                                     ToolTip="Confirm Password is required." ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="tbpassword" ControlToValidate="tbpassword2" 
                                     CssClass="failureNotification" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Email</td>
            <td>
                <asp:TextBox ID="tbemail" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="tbemail" 
                                     CssClass="failureNotification" ErrorMessage="E-mail is required." ToolTip="E-mail is required." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Role</td>
            <td>
   <asp:DropDownList ID="tbrole" runat="server" DataSourceID="SqlDataSource2" 
        DataTextField="RoleName" DataValueField="RoleName">
</asp:DropDownList>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="Data Source=lyra.ccec.unf.edu;Initial Catalog=cop67112012teama2;Persist Security Info=True;User Id=cop67112012teama2;Password=Teama2" 
        SelectCommand="SELECT [RoleName] FROM [aspnet_Roles]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="Data Source=lyra.ccec.unf.edu;Initial Catalog=cop67112012teama2;Persist Security Info=True;User Id=cop67112012teama2;Password=Teama2" 
        SelectCommand="SELECT [RoleName] FROM [aspnet_Roles]">
    </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                <asp:Button ID="Submitbt" runat="server" Text="Submit" 
                    onclick="Submitbt_Click" ValidationGroup="RegisterUserValidationGroup"/>
            </td>
        </tr>
    </table>
</asp:Content>
